import 'package:get/get.dart';
import 'package:shared_preferences/shared_preferences.dart';
class CountController extends GetxController{
  var count = 0.obs;
  increment() => count.value++;
  static CountController get to=>Get.find<CountController>();
  @override
  void onInit() {
    ever(count,(callback) async {
      // final prefs = await SharedPreferences.getInstance();
      final prefs = Get.find<SharedPreferences>();
      prefs.setInt('getXCounter',count.value).then((bool success){
        print("SharedPreferences has set [getXCounter] success");
      });

    });
    super.onInit();
  }
}